#include <iostream>
#include <vector>
#include <string>

using namespace std;

class Solution
{
public:
    vector<string> buildArray(vector<int>& target, int n)
    {
        vector<string> vs;
        int j = 0;
        for (int i = 1; i <= n; i++)
        {
            vs.emplace_back("Push");
            if (target[j] != i)
            {
                vs.emplace_back("Pop");
            }
            else
                j++;
            if (j == target.size())
                break;
        }
        return vs;
    }
};
int main()
{
    vector<int> target = { 1, 3 }; 
    int n = 3;

    Solution xz;
    vector<string> v = xz.buildArray(target, n);
    for (auto e : v)
    {
        cout << e << ' ';
    }

	return 0;
}